perm filename SAVEIT.LES[NEW,AIL] blob
sn#084499 filedate 1979-01-08 generic text, type T, neo UTF8
PROCEDURE SAVE_IT; BEGIN
COMMENT If you are doing no I/O, you may call this procedure. It
saves the accumulators, sets up a new starting address, and exits.
If you then say "SSAV <file>" (or "SAVE ..." if you have no segment)
then subquently RUN <file>, it will start at the point where this
procedure was called, thus preserving all strings, items, etc.,
that would be cleared in a normal start. Note that you cannot
subsequently give ↑C and start the program again, since SAIL's
storage allocation would become hopelessly confused. To inhibit
this, any such attempt draws an error message. ;
SIMPLE PROCEDURE BOMB; BEGIN
OUTSTR("
Sorry, you can't restart this program. Please get a new copy.
");
CALL(0,"EXIT");
END;
START_CODE
SAFE OWN INTEGER ARRAY SAVACS[0:'17];
EXTERNAL INTEGER JOBSA,JOBREL;
LABEL RESTART,RERESTART;
MOVE JOBSA;
HRRI RERESTART;
PUSH '17,0;
MOVEM '17,SAVACS['17];
MOVEI '17,SAVACS[0];
BLT '17,SAVACS['16];
HRL JOBREL;
HRRI RESTART;
MOVEM JOBSA;
CALLI 0,'12;
RERESTART: PUSHJ '17,BOMB;
RESTART:
MOVSI '17,SAVACS[0];
BLT '17,'17;
POP '17,JOBSA;
CALLI 0,0;
END
END "SAVE_IT";